#include "iostream"
#include "stdlib.h"
using namespace std;

#define MaxSize 10
#define InitSize 10

struct ElemType{
	int n;
	ElemType *next;
};

typedef struct LNode{
	ElemType data;
	LNode* next;
}*LinkStack;

void init(LinkStack &S);
void destory(LinkStack &S);

void push(LinkStack &S,ElemType e);
void pop(LinkStack &S,ElemType &e);

void getTop(LinkStack &S,ElemType &e);
bool isEmpty(LinkStack S);


int main(){
	 
	return 0;
}

void init(LinkStack &S){
	S->next=NULL;
}
void destory(LinkStack &S){
	ElemType e;
	while(!isEmpty(S))
		pop(S,e);
	free(S);
}
bool isEmpty(LinkStack S){
	if(S->next==NULL)
		return true;
	return false;
}
void push(LinkStack &S,ElemType e){
	
	LNode* p = (LNode*)malloc(sizeof(LNode));
	p->data = e;
	p->next = S->next;
	S->next = p;
	
}
void pop(LinkStack &S,ElemType &e){
	if(isEmpty(S))
		return;
	e = S->next->data;
	S->next = S->next->next;
}

void getTop(LinkStack &S,ElemType &e){

	e = S->next->data;
}















